<template name="daka">
	<view>
	
		<view>
			<scroll-view :scroll-y="modalName==null" class="page" :class="modalName!=null?'show':''">
		
				<view class="cu-bar bg-white solid-bottom  margin-top">
					<view class="action">
						<text class="cuIcon-title text-yellow "></text> 打卡记录（每周清零）
					</view>
				</view>
				<view class="cu-list menu-avatar" v-for="(item,index) in dakalist" :key="index" >
					
					<view class="cu-item">
						<view class="cu-avatar round lg" style="background-color:#9000FF;font-size: 16rpx;">{{item.nickName}}</view>
						<view class="content">
							<view class="text-gray text-sm flex" style="flex-direction: column;">
									<view  style="display: inline-flex;">
										<view  class="" v-for="(item1,index) in weekcolorList" :key="index" v-if="item1.name!='white'">
											<view  v-if="item.weekdays.indexOf(item1.id)!==-1"class="cu-tag round" 
											:class="'bg-yellow' "
											>
											{{item1.title}}<p/>
											</view>
											<view  v-if="item.weekdays.indexOf(item1.id)===-1"class="cu-tag round"
											:class="'bg-gray' "
											>
											{{item1.title}}<p/>
											</view>
										</view>
									</view>
								</view>
						</view>
						<view class="action" >
							<view class="text-grey text-xs" >{{item.time}}</view>
							<view class="cu-tag round bg-yellow sm">{{item.weekdays.length}}</view>
						</view>
					</view>
			
				</view>
			 <view v-if="dakalist.length>1"  class="cu-list menu" :class="[menuBorder?'sm-border':'',menuCard?'card-menu margin-top':'']">
			 	 
			 	<view class="cu-item" :class="menuArrow?'arrow':''" >
			 		<view class="content">
			 			<text class="cuIcon-emojiflashfill text-yellow"></text>
			 			<text class="text-grey">本周打卡</text>
			 		</view>
			 		<view class="action" >
			 			<view class="cu-avatar-group">
					 ......
					 </view>
			 			<text class="text-grey text-sm">{{dakalist.length}} 人</text>
			 		</view>
					
					<view class="margin-tb-lg text-center">
						</view>
			 	</view>
				
			 </view>
		
			</scroll-view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "daka",
	
		data() {
			return {
				modalName: null,
				description:'',
				menuBorder: false,
				menuArrow: false,
				menuCard: false,
				skin: false,
				loading:false,
				dakalist:[],
				weekcolorList:[{
					title: '一',
					name: 'red',
					id :'1',
					color: '#e54d42'
				},
				{
					title: '二',
					name: 'orange',
					id :	'2',
					color: '#f37b1d'
				},
				{
					title: '三',
					name: 'yellow',
					id :'3',
					color: '#fbbd08'
				},
				{
					title: '四',
					name: 'olive',
					id :'4',
					color: '#8dc63f'
				},
				{
					title: '五',
					name: 'green',
					id :'5',
					color: '#39b54a'
				},
				{
					title: '六',
					name: 'cyan',
					id :'6',
					color: '#1cbbb4'
				},
				{
					title: '日',
					name: 'blue',
					id :'7',
					color: '#0081ff'
				},]
			}
		},
		created() {
			this.refreshList();
			this.nickName = uni.getStorage({key:'nickName'}) 
			this.description = uni.getStorage({key:'description'})
		},
		methods: {
			
			showModal(e) {
				this.modalName = e.currentTarget.dataset.target
			},
		
			MenuBorder(e) {
				this.menuBorder = e.detail.value
			},
			MenuArrow(e) {
				this.menuArrow = e.detail.value
			},
			MenuCard(e) {
				this.menuCard = e.detail.value
			},
			refreshList(e){
				uni.request({
				    // url: 'http://localhost:8081/service/findAll1', 
					url: '/service/findAll1',
					method:"GET",
				    success: (res) => {
						if(res.statusCode!==500){
							console.log('success',res);
							this.dakalist = res.data.list;
						}else{
							console.log('fail',res);
							this.dakalist = [];
						}
				    },
				});
			},
					
		},
	
	}
</script>

<style>
	.page {
		height: 100vh;
		background-color: #FFF;
	}
	.cu-list.menu-avatar>.cu-item .content 
	{
		left: 100rpx;
	}
	.cu-list.menu-avatar>.cu-item .action{
		width: 600rpx;
		text-align: right;
	}
</style>
